package com.zlf.blog.controller;

import com.zlf.blog.dao.pojo.SysUser;
import com.zlf.blog.service.SysUserService;
import com.zlf.blog.utils.UserThreadLocal;
import com.zlf.blog.vo.ChangeUserInfoVo;
import com.zlf.blog.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zlfi1
 */
@RestController
@RequestMapping("/users")
@CrossOrigin
@Api(tags="token验证")
public class UserController {

    @Autowired
    private SysUserService sysUserService;

    @GetMapping("currentUser")
    public Result currentUser(@RequestHeader("Authorization") String token){
        return sysUserService.getUserInfoByToken(token);
    }


}